
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script src="../js/vue.js"></script>
 <h1>
  ---v-on 绑定事件 <br>
    -- 语法: v-on:事件名 ='内敛语句' <br>
    --简写 @事件名 = '内敛语句' <br>

 </h1>
  <div id="root">
  <button v-on:click="count--">-</button>
  <span>{{count}}</span>
  <button @click="count++">+</button>

  <button @click="fn(100)">点我加100</button>

<button @click="fn1">点我显示隐藏</button>
  <h1 v-show="flag">我是帅帅呀</h1>
 </div>
 <script>
    new Vue({
      el:'#root',
      data:{
        count:100,
        flag:true
      },
      methods: {
        fn(n){
          this.count += n
        },
        fn1(){
          this.flag = !this.flag
        }
      },
    })
  </script>
</body>
</html>